extends CanvasLayer

var KeyEvents: Array

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	$Label.vertical_alignment = VERTICAL_ALIGNMENT_BOTTOM


# Called every frame. 'delta' is the elapsed time since the previous frame.

func add_line(label, varible):
	$Label.text += label + " " + str(varible) + "\n"
	

func _process(delta: float) -> void:
	$Label.text = ""
	add_line("FPS", round(1 / delta))
	add_line("Jump Count", get_node("%Player").JumpCount)
	add_line("Player veclocity.y", get_node("%Player").velocity.y)
	add_line("Player State", get_node("%Player").CurrentState)
	add_line("Coin Number", PlayerData.Coin)
	add_line("Player HP", PlayerData.PlayerHP)
	#$KeyHistory.text = "Input History" + "\n" + "\n".join(KeyEvents)


func _input(event):
	KeyEvents.insert(0, "> " + event.as_text())
	if len(KeyEvents) > 10:
		KeyEvents.pop_back()
